<template>
  <div class="song-list">
    <div class="banner">
      <div class="mask" :style="{background:'url('+playlistInfo.coverImgUrl+')'}"></div>
      <div class="pic">
        <div>
          <img :src="playlistInfo.coverImgUrl" width="94px" height="94px">
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 用来保存歌曲详情
      playlistInfo: {}
    }
  },
  created() {
    this.getPlaylistDetail()
  },
  methods: {
    getPlaylistDetail() {
      let id = this.$route.params.id;
      this.$http('/playlist/detail', {params: {id}})
        .then(res => {
          this.playlistInfo = res.data.playlist
        })
        .catch(err => {
          console.log(err);
        })
    }
  },
}
</script>

<style>
.song-list .banner {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: hidden;
}
.song-list .mask {
  width: 100%;
  height: 180px;
  z-index: -1;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background-repeat: no-repeat;
  background-size: cover;
  /* background-position: 50%; */
  filter: blur(20px);
  transform: scale(1.5);
}
.banner .pic {
  top: 25%;
  bottom: 0;
  z-index: 2;
  padding-left: 20px;
  box-sizing: border-box;
  position: relative;
}
</style>